package org.chen.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.chen.common.model.travel.StoreTravelOrderInfo;
import org.chen.mapper.StoreTravelOrderInfoMapper;
import org.chen.service.StoreTravelOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StoreTravelOrderInfoServiceImpl extends ServiceImpl<StoreTravelOrderInfoMapper, StoreTravelOrderInfo> implements StoreTravelOrderInfoService {

    @Autowired
    private StoreTravelOrderInfoMapper storeTravelOrderInfoMapper;

    /**
     * 获取订单详情-订单编号(旅游)
     * @param orderNo 订单编号
     * @return List
     */
    @Override
    public List<StoreTravelOrderInfo> getListByOrderNoTravel(String orderNo) {
        LambdaQueryWrapper<StoreTravelOrderInfo> lqw = Wrappers.lambdaQuery();
        lqw.eq(StoreTravelOrderInfo::getOrderNo, orderNo);
        return storeTravelOrderInfoMapper.selectList(lqw);
    }

    /**
     * 新增订单详情(旅游)
     * @param storeOrderInfos 订单详情集合
     * @return 订单新增结果
     */
    @Override
    public boolean saveTravelOrderInfos(List<StoreTravelOrderInfo> storeOrderInfos) {
        return saveBatch(storeOrderInfos);
    }
}
